//
//  BackupsSwitchView.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/1/27.
//

import SwiftUI

//聊天模型选择
struct ChatModelDialogView: View {
    let dismiss: () -> Void

    var body: some View {
        PopupBottomView(title: "请选择聊天模型") {
            VStack(spacing: 15) {
                HStack() {
                    VStack(alignment: .leading) {
                        Text("聊天模型1")
                            .font(.system(size: 16))
                            .foregroundStyle(.bgNormalText2)
                    }
                    Spacer()
                }.padding(.horizontal,15)
                    .frame(height: 80)
                    .background(IChatModelType.TYPE_0 == AppStorageManager.shared.aiModel ? themeManager.themeColor.opacity(0.2) : .bgItemGray)
                    .cornerRadius(15)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        AppStorageManager.shared.aiModel = IChatModelType.TYPE_0
                        dismiss()
                    }
                HStack() {
                    VStack(alignment: .leading) {
                        Text("聊天模型2")
                            .font(.system(size: 16))
                            .foregroundStyle(.bgNormalText2)
                    }
                    Spacer()
                }.padding(.horizontal,15)
                    .frame(height: 80)
                    .background(IChatModelType.TYPE_1 == AppStorageManager.shared.aiModel ? themeManager.themeColor.opacity(0.2) : .bgItemGray)
                    .cornerRadius(15)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        AppStorageManager.shared.aiModel = IChatModelType.TYPE_1
                        dismiss()
                    }
                
            }.padding(.top,15)
                
        }
    }
}

//#Preview {
//    ChatModelDialogView()
//}
//定义预览提供者
struct ChatModelDialogView_Previews: PreviewProvider {
    static var previews: some View {
        //使用预览共享配置
        configurePreviewEnvironment(for: ChatModelDialogView(){})
    }
}
